<%@ page language="java"
         contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"
         import="com.shxt.hotel.background.Room"
         import="java.util.Map"
         import="java.util.List"
         import="com.shxt.hotel.background.Staff"
%>
<%
    Staff staff = new Staff();
    
    if(session.getAttribute("staff_id") == null){
        response.sendRedirect("./login.jsp");
    }else{
        // get current Staff
        request.setCharacterEncoding("UTF-8");
        int staff_id = (int)session.getAttribute("staff_id");
        
        // room object
        Room room = new Room();
%>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Mosaddek">
    <meta name="keyword" content="FlatLab, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
    <link rel="shortcut icon" href="../Public/img/favicon.html">

    <title>Form Component</title>

    <!-- Bootstrap core CSS -->
    <link href="../Public/css/bootstrap.min.css" rel="stylesheet">
    <link href="../Public/css/bootstrap-reset.css" rel="stylesheet">
    <!--external css-->
    <link href="../Public/assets/font-awesome/css/font-awesome.css" rel="stylesheet" />

    <link rel="stylesheet" type="text/css" href="../Public/assets/bootstrap-datepicker/css/datepicker.css" />
    <link rel="stylesheet" type="text/css" href="../Public/assets/bootstrap-colorpicker/css/colorpicker.css" />
    <link rel="stylesheet" type="text/css" href="../Public/assets/bootstrap-daterangepicker/daterangepicker.css" />

    <!-- Custom styles for this template -->
    <link href="../Public/css/style.css" rel="stylesheet">
    <link href="../Public/css/style-responsive.css" rel="stylesheet" />

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
    <!--[if lt IE 9]>
      <script src="../Public/js/html5shiv.js"></script>
      <script src="../Public/js/respond.min.js"></script>
    <![endif]-->


</head>

<body>

    <section id="container" class="">
        <!--header start-->
        <jsp:include page="./Public/header.jsp" flush="true" />
        <!--header end-->
        <!--sidebar start-->
        <jsp:include page="./Public/sidebar.jsp" flush="true" />
        <!--sidebar end-->
        <!--main content start-->
        <section id="main-content">
            <section class="wrapper">
                <!-- page start-->
                <div class="row">
                    <div class="col-lg-8">
                        <section class="panel panel-primary">
                            <header class="panel-heading">
                                New Room Type
                            </header>
                            <div class="panel-body">
                                <form class="form-horizontal" role="form" action="./background/room_category_add_do.jsp" method="post">
                                    <%
                                        List<Map<String, Object>> cateList = room.getCategories("id");
                                        int cateSize = cateList.size();
                                    %>
                                    <div class="form-group">
                                        <label for="inputEmail1" class="col-lg-2 control-label">Type ID</label>
                                        <div class="col-lg-10">
                                            <input class="form-control" type="text" name="id" value="<%=cateSize%>" autocomplete="off">
                                            <p class="form-control-static"></p>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="room_type_name" class="col-lg-2 control-label">Type Name</label>
                                        <div class="col-lg-10">
                                            <input type="text" class="form-control" name="title" id="room_type_name" placeholder="Type Name" autocomplete="off">
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label for="room_type_intro" class="col-lg-2 control-label">Intro</label>
                                        <div class="col-lg-10">
                                            <textarea name="intro" class="form-control"></textarea>
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label for="room_type_price" class="col-lg-2 control-label">Price</label>
                                        <div class="col-lg-10">
                                            <input name="price" type="text" class="form-control" placeholder="Price"  autocomplete="off">
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label for="room_type_bed" class="col-lg-2 control-label">Bed</label>
                                        <div class="col-lg-10">
                                            <div class="radio">
                                                <label for="">
                                                    <input type="radio" name="bed" value="1">Single
                                                </label>
                                            </div>
                                            <div class="radio">
                                                <label for="">
                                                    <input type="radio" name="bed" value="2">Double                                                    
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label col-lg-2">Equip</label>
                                        <div class="col-lg-10">
                                            <div class="checkbox">
                                                <label for="">
                                                    <input type="checkbox" name="wifi" value="1">Wifi
                                                </label>
                                            </div>
                                            <div class="checkbox">
                                                <label for="">
                                                    <input type="checkbox" name="bathroom" value="1">Bathroom
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label for="" class="control-label col-lg-2">Area</label>
                                        <div class="col-lg-4">
                                            <input class="form-control" type="text" name="area_min" value="" placeholder="Min"  autocomplete="off">
                                        </div>
                                        <div class="col-lg-4">
                                            <input class="form-control" type="text" name="area_max" value="" placeholder="Max"  autocomplete="off">
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <div class="col-lg-offset-2 col-lg-10">
                                            <button type="submit" class="btn btn-info">Submit</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </section>
                    </div>
                </div>
                <!-- page end-->
            </section>
        </section>
        <!--main content end-->
    </section>

    <!-- js placed at the end of the document so the pages load faster -->
    <script src="../Public/js/jquery.js"></script>
    <script src="../Public/js/bootstrap.min.js"></script>
    <script src="../Public/js/jquery.scrollTo.min.js"></script>
    <script src="../Public/js/jquery.nicescroll.js" type="text/javascript"></script>

    <script src="../Public/js/jquery-ui-1.9.2.custom.min.js"></script>

    <!--custom switch-->
    <script src="../Public/js/bootstrap-switch.js"></script>
    <!--custom tagsinput-->
    <script src="../Public/js/jquery.tagsinput.js"></script>
    <!--custom checkbox & radio-->
    <script type="text/javascript" src="../Public/js/ga.js"></script>

    <script type="text/javascript" src="../Public/assets/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
    <script type="text/javascript" src="../Public/assets/bootstrap-daterangepicker/date.js"></script>
    <script type="text/javascript" src="../Public/assets/bootstrap-daterangepicker/daterangepicker.js"></script>
    <script type="text/javascript" src="../Public/assets/bootstrap-colorpicker/js/bootstrap-colorpicker.js"></script>
    <script type="text/javascript" src="../Public/assets/ckeditor/ckeditor.js"></script>


    <!--common script for all pages-->
    <script src="../Public/js/common-scripts.js"></script>

    <!--script for this page-->
    <script src="../Public/js/form-component.js"></script>
    
    <!--scripted by myself-->
    <script>
        $(document).ready(function(){
            $("#Hotel_Room_Type").addClass("active");
            $("#room_category_add").addClass("active");
        });
    </script>

</body>

</html>
<%
        room.close();
    }
%>